home *** CD-ROM | disk | FTP | other *** search
- #include <windows.h> // required for all Windows applications
- #include "resource.h" // Windows resource IDs
- #include "3dshell.h" // specific to this program
- #include <stdio.h>
-
- #include "Box3DSupport.h"
-
- HINSTANCE hInst; // current instance
-
- DocumentPtr gDocument;
-
- char szAppName[] = "QuickDraw 3D Demo"; // The name of this application
- char szTitle[] = "QuickDraw 3D Demo"; // The title bar text
-
- void OpenModelFile(void);
- void SaveModelFile(void);
-
- TQ3Status BrowseForPathName(char *inPathName, BOOLEAN fOpen);
-
- void UpdateFrame(void);
-
- void InitDocumentData( DocumentPtr theDocument, HWND inWindow );
- void DisposeDocumentData( DocumentPtr theDocument);
- TQ3Status DocumentDraw3DData( DocumentPtr theDocument );
-
- TQ3Status DocumentNewWindowSize(DocumentPtr theDocument, unsigned long width, unsigned long height);
-
- TQ3Status PaintDocumentWindow(DocumentPtr theDocument);
-
- TQ3Status GetToolBarPosition(DocumentPtr theDocument, unsigned long *x, unsigned long *y);
- TQ3Status GetToolBarSize(DocumentPtr theDocument, unsigned long *width, unsigned long *height);
- static void MyErrorHandler(TQ3Error firstError, TQ3Error lastError, long refCon);
- #define REFERROR 00L
- #define REFWARNING 01L
- #define REFNOTICE 02L
-
- static void StartTimer( void );
- static void StopTimer( void );
-
- VOID CALLBACK TimerProc( HWND, UINT, UINT, DWORD );
- UINT gTimer;
-
-
- int CALLBACK WinMain(
- HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow)
- {
- MSG msg;
- HANDLE hAccelTable;
-
- if (!InitApplication(hInstance))
- {
- return (FALSE);
- }
-
- if (!InitInstance(hInstance, nCmdShow))
- {
- return (FALSE);
- }
-
- hAccelTable = LoadAccelerators (hInstance, MAKEINTRESOURCE(IDR_GENERIC));
-
- StartTimer();
- while (GetMessage(&msg, NULL, 0, 0)) {
- if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- }
- StopTimer();
-
- return (msg.wParam); // Returns the value from PostQuitMessage
- }
-
- void UpdateFrame(void)
- {
- TQ3Matrix4x4 tmp;
- RECT aWinRect;
- BOOL aResult;
-
- Q3Matrix4x4_SetRotate_XYZ(&tmp, 0.05F, 0.05F, 0.05F);
- Q3Matrix4x4_Multiply(&gDocument->fRotation, &tmp, &gDocument->fRotation);
- aResult = GetClientRect(gDocument->fWindow, (LPRECT)&aWinRect);
- aWinRect.bottom = aWinRect.top + gDocument->fHeight;
- aResult = InvalidateRect(gDocument->fWindow, &aWinRect, FALSE);
- }
-
-
- BOOL InitApplication(HINSTANCE hInstance)
- {
- WNDCLASS wc;
-
- wc.style = CS_HREDRAW | CS_VREDRAW;
- wc.lpfnWndProc = (WNDPROC)WndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 0;
- wc.hInstance = hInstance;
- wc.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_APP));
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
- wc.lpszMenuName = MAKEINTRESOURCE(IDR_GENERIC);
- wc.lpszClassName = szAppName;
-
- return (RegisterClass(&wc));
- }
-
- BOOL InitInstance(
- HINSTANCE hInstance,
- int nCmdShow)
- {
- HWND hWnd;
-
- hInst = hInstance;
- hWnd = CreateWindowEx(
- WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE,
- szAppName,
- szTitle,
- WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU,
- 25, 25, 400, 450, // fixed size windows
- NULL,
- NULL,
- hInstance,
- NULL
- );
-
- if (!hWnd)
- {
- return (FALSE);
- }
-
-
- ShowWindow(hWnd, nCmdShow);
- UpdateWindow(hWnd);
-
- return (TRUE);
-
- }
-
- static void StartTimer( void )
- {
- gTimer = SetTimer( NULL, 0, 100, (TIMERPROC) TimerProc );
- }
-
- static void StopTimer( void )
- {
- KillTimer( NULL, gTimer );
- }
-
- VOID CALLBACK TimerProc(
- HWND hwnd, // handle of window for timer messages
- UINT uMsg, // WM_TIMER message
- UINT idEvent, // timer identifier
- DWORD dwTime // current system time
- )
- {
- UpdateFrame();
- }
-
-
- LRESULT CALLBACK WndProc(
- HWND hWnd,
- UINT message,
- WPARAM uParam,
- LPARAM lParam)
- {
- int wmId, wmEvent;
- TQ3Status aStatus;
- PAINTSTRUCT PaintStruct;
-
- switch (message)
- {
- case WM_COMMAND:
-
- wmId = LOWORD(uParam);
- wmEvent = HIWORD(uParam);
-
- switch (wmId)
- {
- case IDM_ABOUT:
- StopTimer();
- DialogBox(hInst,
- MAKEINTRESOURCE(IDD_ABOUTBOX),
- hWnd,
- (DLGPROC)About);
- StartTimer();
- break;
- case IDM_OPEN:
- StopTimer();
- OpenModelFile();
- StartTimer();
- break;
- case IDM_SAVEAS:
- StopTimer();
- SaveModelFile();
- StartTimer();
- break;
-
- case IDM_EXIT:
- DestroyWindow (hWnd);
- break;
-
- default:
- return (DefWindowProc(hWnd, message, uParam, lParam));
- }
- break;
-
- case WM_CREATE:
- aStatus = Q3Initialize();
- Q3Error_Register( MyErrorHandler, REFERROR );
- Q3Warning_Register( MyErrorHandler, REFWARNING );
- Q3Notice_Register( MyErrorHandler, REFNOTICE );
- gDocument = (DocumentPtr)malloc(sizeof(DocumentRec));
- InitDocumentData(gDocument, hWnd);
- break;
-
- case WM_DESTROY: // message: window being destroyed
- PostQuitMessage(0);
- DisposeDocumentData(gDocument);
- free(gDocument);
- aStatus = Q3Exit();
- break;
-
- case WM_PAINT:
- BeginPaint(gDocument->fWindow, &PaintStruct);
- DocumentDraw3DData(gDocument);
- EndPaint(gDocument->fWindow, &PaintStruct);
- break;
-
- default: // Passes it on if unproccessed
- return (DefWindowProc(hWnd, message, uParam, lParam));
- }
- return (0);
- }
-
- static void MyErrorHandler(TQ3Error firstError, TQ3Error lastError, long refCon)
- {
- char buf[512];
- switch( refCon )
- {
- case REFERROR:
- sprintf(buf, "QD3D ERROR %d\n", lastError);
- break;
- case REFWARNING:
- sprintf(buf, "QD3D WARNING %d\n", lastError);
- break;
- case REFNOTICE:
- sprintf(buf, "QD3D NOTICE %d\n", lastError);
- break;
- }
- OutputDebugString(buf);
- }
-
- char ExtFilter[] = "QuickDraw 3D Metafiles\0*.3dmf;*.3dm;*.q3d;*.qd3d\0All Files\0*.*\0\0";
-
- // put up common dialog; fOpen == TRUE for Open, FALSE for Save As.
- TQ3Status BrowseForPathName(char *inPathName, BOOLEAN fOpen)
- {
- OPENFILENAME aFileName;
- TQ3Status aStatus = kQ3Success;
-
- inPathName[0] = 0;
- aFileName.lStructSize = sizeof(OPENFILENAME);
- aFileName.hwndOwner = gDocument->fWindow;
- aFileName.hInstance = NULL;
- aFileName.lpstrFilter = ExtFilter;
- aFileName.lpstrCustomFilter = NULL;
- aFileName.nMaxCustFilter = 0L;
- aFileName.nFilterIndex = 0;
- aFileName.lpstrFile = inPathName;
- aFileName.nMaxFile = 255;
- aFileName.lpstrFileTitle = NULL;
- aFileName.nMaxFileTitle = 0;
- aFileName.lpstrInitialDir = NULL;
- aFileName.lpstrTitle = NULL;
- aFileName.Flags = OFN_EXPLORER + OFN_LONGNAMES + OFN_PATHMUSTEXIST;
- if( fOpen )
- aFileName.Flags += OFN_FILEMUSTEXIST;
- aFileName.nFileOffset = 0;
- aFileName.nFileExtension = 0;
- aFileName.lpstrDefExt = NULL;
- aFileName.lCustData = 0;
- aFileName.lpfnHook = NULL;
- aFileName.lpTemplateName = NULL;
- if (fOpen )
- if (GetOpenFileName((LPOPENFILENAME)&aFileName))
- aStatus = kQ3Success;
- else
- aStatus = kQ3Failure;
- else //saving
- if (GetSaveFileName((LPOPENFILENAME)&aFileName))
- aStatus = kQ3Success;
- else
- aStatus = kQ3Failure;
-
- return aStatus;
- }
-
- #if 0 // Use UnixPathStorage
- void OpenModelFile(void)
- {
- #undef A3Assert
- #define A3Assert(x) if (!(x)) goto ExitOpenModelFile
-
- char *pathName;
- char pathNameChars[255];
- TQ3StorageObject srcStorage = NULL;
- TQ3FileObject srcFileObject = NULL;
- TQ3GroupObject aGroup = NULL;
- TQ3Object anObject = NULL;
- TQ3FileMode srcFileMode;
- TQ3GroupPosition aPosition;
- FILE *aFile;
- TQ3Status aStatus;
- int aResult;
- RECT aWinRect;
- BOOL aBoolResult;
-
- pathName = &(pathNameChars[0]);
- if (BrowseForPathName(pathName, TRUE) != kQ3Success)
- goto ExitOpenModelFile;
- //aFile = fopen(pathName, "rb");
- A3Assert((srcFileObject = Q3File_New()) != NULL);
- A3Assert((srcStorage = Q3UnixPathStorage_New(pathName)) != NULL);
- A3Assert((aStatus = Q3File_SetStorage(srcFileObject, srcStorage)) == kQ3Success);
- A3Assert((aStatus = Q3File_OpenRead(srcFileObject, &srcFileMode)) == kQ3Success);
- A3Assert((aGroup = Q3DisplayGroup_New()) != NULL);
- while (Q3File_IsEndOfFile(srcFileObject) == kQ3False)
- {
- A3Assert((anObject = Q3File_ReadObject(srcFileObject)) != NULL);
- A3Assert(Q3Error_Get(NULL) == kQ3ErrorNone);
- if (Q3Object_IsDrawable(anObject) == kQ3True)
- A3Assert((aPosition = Q3Group_AddObject(aGroup, anObject)) != NULL);
- A3Assert(Q3Object_Dispose(anObject) == kQ3Success);
- anObject = NULL;
- }
- A3Assert((Q3Object_Dispose(gDocument->fModel)) == kQ3Success);
- gDocument->fModel = aGroup;
- A3Assert((aStatus = Q3File_Close(srcFileObject)) == kQ3Success);
- //aResult = fclose(aFile);
- A3Assert((aStatus = Q3Object_Dispose(srcFileObject)) == kQ3Success);
- A3Assert((aStatus = Q3Object_Dispose(srcStorage)) == kQ3Success);
- gDocument->fControlStripVisible = kQ3True;
- pvCamera_Fit(gDocument);
- /* UpdateWindow(gDocument->fWindow); */
- aBoolResult = GetClientRect(gDocument->fWindow, (LPRECT)&aWinRect);
- aBoolResult = InvalidateRect(gDocument->fWindow, &aWinRect, FALSE);
-
- ExitOpenModelFile:
- ;
- }
- #else // use UnixStorage
- void OpenModelFile(void)
- {
- #undef A3Assert
- #define A3Assert(x) if (!(x)) goto ExitOpenModelFile
-
- char *pathName;
- char pathNameChars[255];
- TQ3StorageObject srcStorage = NULL;
- TQ3FileObject srcFileObject = NULL;
- TQ3GroupObject aGroup = NULL;
- TQ3Object anObject = NULL;
- TQ3FileMode srcFileMode;
- TQ3GroupPosition aPosition;
- FILE *aFile;
- TQ3Status aStatus;
- int aResult;
- RECT aWinRect;
- BOOL aBoolResult;
-
- pathName = &(pathNameChars[0]);
- if (BrowseForPathName(pathName, TRUE) != kQ3Success)
- goto ExitOpenModelFile;
- aFile = fopen(pathName, "rb");
- A3Assert((srcFileObject = Q3File_New()) != NULL);
- A3Assert((srcStorage = Q3UnixStorage_New(aFile)) != NULL);
- A3Assert((aStatus = Q3File_SetStorage(srcFileObject, srcStorage)) == kQ3Success);
- A3Assert((aStatus = Q3File_OpenRead(srcFileObject, &srcFileMode)) == kQ3Success);
- A3Assert((aGroup = Q3DisplayGroup_New()) != NULL);
- while (Q3File_IsEndOfFile(srcFileObject) == kQ3False)
- {
- A3Assert((anObject = Q3File_ReadObject(srcFileObject)) != NULL);
- A3Assert(Q3Error_Get(NULL) == kQ3ErrorNone);
- if (Q3Object_IsDrawable(anObject) == kQ3True)
- A3Assert((aPosition = Q3Group_AddObject(aGroup, anObject)) != NULL);
- A3Assert(Q3Object_Dispose(anObject) == kQ3Success);
- anObject = NULL;
- }
- A3Assert((Q3Object_Dispose(gDocument->fModel)) == kQ3Success);
- gDocument->fModel = aGroup;
- A3Assert((aStatus = Q3File_Close(srcFileObject)) == kQ3Success);
- aResult = fclose(aFile);
- A3Assert((aStatus = Q3Object_Dispose(srcFileObject)) == kQ3Success);
- A3Assert((aStatus = Q3Object_Dispose(srcStorage)) == kQ3Success);
- gDocument->fControlStripVisible = kQ3True;
- pvCamera_Fit(gDocument);
- /* UpdateWindow(gDocument->fWindow); */
- aBoolResult = GetClientRect(gDocument->fWindow, (LPRECT)&aWinRect);
- aBoolResult = InvalidateRect(gDocument->fWindow, &aWinRect, FALSE);
-
- ExitOpenModelFile:
- ;
- }
- #endif //0
-
- void SaveModelFile(void)
- {
- #undef A3Assert
- #define A3Assert(x) if (!(x)) goto ExitSaveModelFile
-
- char *pathName;
- char pathNameChars[255];
- TQ3FileObject dstFileObject = NULL;
- TQ3StorageObject dstStorage = NULL;
- TQ3FileMode dstFileMode;
- TQ3ViewObject dstView;
- TQ3Status aStatus;
- TQ3ViewStatus aViewStatus;
- FILE *aFile;
- int aResult;
-
- pathName = &(pathNameChars[0]);
- if (BrowseForPathName(pathName, FALSE) != kQ3Success)
- goto ExitSaveModelFile;
- aFile = fopen(pathName, "wb");
- A3Assert((dstFileObject = Q3File_New()) != NULL);
- A3Assert((dstStorage = Q3UnixStorage_New(aFile)) != NULL);
- A3Assert((aStatus = Q3File_SetStorage(dstFileObject, dstStorage)) == kQ3Success);
- A3Assert((dstView = Q3View_New()) != NULL);
- dstFileMode = kQ3FileModeNormal;
- A3Assert((aStatus = Q3File_OpenWrite(dstFileObject, dstFileMode)) == kQ3Success);
- A3Assert((aStatus = Q3View_StartWriting(dstView, dstFileObject)) == kQ3Success);
- do
- {
- A3Assert((aStatus = Q3Object_Submit(gDocument->fModel, dstView)) == kQ3Success);
- A3Assert((aViewStatus = Q3View_EndWriting(dstView)) != kQ3ViewStatusError);
- } while (aViewStatus == kQ3ViewStatusRetraverse);
- A3Assert((aStatus = Q3File_Close(dstFileObject)) == kQ3Success);
- aResult = fclose(aFile);
- A3Assert((aStatus = Q3Object_Dispose(dstFileObject)) == kQ3Success);
- A3Assert((aStatus = Q3Object_Dispose(dstStorage)) == kQ3Success);
-
- ExitSaveModelFile:
- ;
- }
-
-
-
- BOOL CenterWindow (HWND hwndChild, HWND hwndParent)
- {
- RECT rChild, rParent;
- int wChild, hChild, wParent, hParent;
- int wScreen, hScreen, xNew, yNew;
- HDC hdc;
-
- // Get the Height and Width of the child window
- GetWindowRect (hwndChild, &rChild);
- wChild = rChild.right - rChild.left;
- hChild = rChild.bottom - rChild.top;
-
- // Get the Height and Width of the parent window
- GetWindowRect (hwndParent, &rParent);
- wParent = rParent.right - rParent.left;
- hParent = rParent.bottom - rParent.top;
-
- // Get the display limits
- hdc = GetDC (hwndChild);
- wScreen = GetDeviceCaps (hdc, HORZRES);
- hScreen = GetDeviceCaps (hdc, VERTRES);
- ReleaseDC (hwndChild, hdc);
-
- // Calculate new X position, then adjust for screen
- xNew = rParent.left + ((wParent - wChild) /2);
- if (xNew < 0) {
- xNew = 0;
- } else if ((xNew+wChild) > wScreen) {
- xNew = wScreen - wChild;
- }
-
- // Calculate new Y position, then adjust for screen
- yNew = rParent.top + ((hParent - hChild) /2);
- if (yNew < 0) {
- yNew = 0;
- } else if ((yNew+hChild) > hScreen) {
- yNew = hScreen - hChild;
- }
-
- // Set it, and return
- return SetWindowPos (hwndChild, NULL,
- xNew, yNew, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
- }
-
-
- // About box callback
- LRESULT CALLBACK About(
- HWND hDlg, // window handle of the dialog box
- UINT message, // type of message
- WPARAM uParam, // message-specific information
- LPARAM lParam)
- {
- static HFONT hfontDlg;
- LPSTR lpVersion;
- DWORD dwVerInfoSize;
- DWORD dwVerHnd;
- UINT uVersionLen;
- WORD wRootLen;
- BOOL bRetCode;
- int i;
- char szFullPath[256];
- char szResult[256];
- char szGetName[256];
-
- switch (message) {
- case WM_INITDIALOG: // message: initialize dialog box
- // Center the dialog over the application window
- CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));
-
- // Get version information from the application
- GetModuleFileName (hInst, szFullPath, sizeof(szFullPath));
- dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd);
- if (dwVerInfoSize) {
- // If we were able to get the information, process it:
- LPSTR lpstrVffInfo;
- HANDLE hMem;
- hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize);
- lpstrVffInfo = GlobalLock(hMem);
- GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpstrVffInfo);
- lstrcpy(szGetName, "\\StringFileInfo\\040904e4\\");
- wRootLen = lstrlen(szGetName);
-
- // Walk through the dialog items that we want to replace:
- for (i = IDC_FILEDESCRIPTION; i <= IDC_LEGALTRADEMARKS; i++) {
- GetDlgItemText(hDlg, i, szResult, sizeof(szResult));
- szGetName[wRootLen] = (char)0;
- lstrcat (szGetName, szResult);
- uVersionLen = 0;
- lpVersion = NULL;
- bRetCode = VerQueryValue((LPVOID)lpstrVffInfo,
- (LPSTR)szGetName,
- (LPVOID)&lpVersion,
- (LPDWORD)&uVersionLen); // For MIPS strictness
-
- if ( bRetCode && uVersionLen && lpVersion) {
- // Replace dialog item text with version info
- lstrcpy(szResult, lpVersion);
- SetDlgItemText(hDlg, i, szResult);
- }
- }
-
- GlobalUnlock(hMem);
- GlobalFree(hMem);
- } // if (dwVerInfoSize)
- return (TRUE);
-
- case WM_COMMAND: // message: received a command
- if (LOWORD(uParam) == IDOK // "OK" box selected?
- || LOWORD(uParam) == IDCANCEL) { // System menu close command?
- EndDialog(hDlg, TRUE); // Exit the dialog
- DeleteObject (hfontDlg);
- return (TRUE);
- }
- break;
- }
- return (FALSE); // Didn't process the message
- }
-
- //-------------------------------------------------------------------------------------------
- //
-
- void InitDocumentData( DocumentPtr theDocument, HWND inWindow )
- {
- RECT aWinRect;
- BOOL aResult;
-
- theDocument->fWindow = inWindow;
- aResult = GetClientRect(inWindow, (LPRECT)&aWinRect);
- theDocument->fWidth = aWinRect.right - aWinRect.left;
- theDocument->fHeight = aWinRect.bottom - aWinRect.top;
-
- // sets up the 3d data for the scene
- // Create view for QuickDraw 3D
- theDocument->fView = MyNewView( theDocument ) ;
-
- // the main display group
- theDocument->fModel = MyNewModel() ;
-
- // the drawing styles:
- theDocument->fInterpolation = Q3InterpolationStyle_New(kQ3InterpolationStyleVertex) ;
- theDocument->fBackFacing = Q3BackfacingStyle_New(kQ3BackfacingStyleBoth ) ;
- theDocument->fFillStyle = Q3FillStyle_New(kQ3FillStyleFilled ) ;
- theDocument->fIllumination = Q3PhongIllumination_New();
-
- // set the rotation matrix the identity matrix
- Q3Matrix4x4_SetIdentity(&theDocument->fRotation);
-
- theDocument->fControlStripVisible = kQ3False;
- theDocument->fViewerMode = kA3BtnRotate;
- }
-
- void DisposeDocumentData( DocumentPtr theDocument)
- {
- Q3Object_Dispose(theDocument->fView) ; // the view for the scene
- Q3Object_Dispose(theDocument->fModel) ; // object in the scene being modelled
- Q3Object_Dispose(theDocument->fInterpolation) ; // interpolation style used when rendering
- Q3Object_Dispose(theDocument->fBackFacing) ; // whether to draw shapes that face away from the camera
- Q3Object_Dispose(theDocument->fFillStyle) ; // whether drawn as solid filled object or decomposed to components
- Q3Object_Dispose(theDocument->fIllumination) ;
- }
- //-----------------------------------------------------------------------------
- //
-
- TQ3Status DocumentDraw3DData( DocumentPtr theDocument )
- {
- RECT aWinRect;
- BOOL aResult;
- HDC hdc;
-
- aResult = GetClientRect(theDocument->fWindow, (LPRECT)&aWinRect);
- hdc = GetDC(theDocument->fWindow);
- Q3View_StartRendering(theDocument->fView );
- do {
- Q3Shader_Submit( theDocument->fIllumination, theDocument->fView );
- Q3Style_Submit( theDocument->fInterpolation, theDocument->fView );
- Q3Style_Submit( theDocument->fBackFacing, theDocument->fView );
- Q3Style_Submit( theDocument->fFillStyle, theDocument->fView );
- Q3MatrixTransform_Submit( &theDocument->fRotation, theDocument->fView );
- Q3DisplayGroup_Submit( theDocument->fModel, theDocument->fView );
- } while (Q3View_EndRendering(theDocument->fView) == kQ3ViewStatusRetraverse );
-
- BitBlt(hdc, 0, 0, theDocument->fWidth, theDocument->fHeight,
- theDocument->fMemoryDC, 0, 0, SRCCOPY);
- GdiFlush();
- ReleaseDC(theDocument->fWindow, hdc);
-
- return kQ3Success ;
- }
-
- TQ3Status DocumentNewWindowSize(DocumentPtr theDocument, unsigned long width, unsigned long height)
- {
- BOOL result;
- TQ3Status aStatus = kQ3Success;
-
- if (theDocument->fControlStripVisible == kQ3True)
- {
- theDocument->fWidth = width;
- theDocument->fHeight = height;
- result = DeleteObject(theDocument->fBitmap);
- result = DeleteDC(theDocument->fMemoryDC);
- Q3Object_Dispose(theDocument->fView);
- theDocument->fView = MyNewView(theDocument);
- pvCamera_Fit(gDocument);
- }
- return aStatus;
- }
-
-